import { createRouter,createWebHistory } from 'vue-router'
import login from '../views/login.vue'

const routes = [
    {
        path:'/login',
        component:login
    },
    {
        path:'/home',
        name:'home',
        component:()=> import('../views/home.vue'),
        children:[
            {
                path:'',
                redirect:'/home/user'
            },
            {
                path:'/home/user',
                name:'user',
                component:()=> import('../views/user.vue')
            }
        ]

    }
]
const router = createRouter(
    {
        history: createWebHistory(import.meta.env.BASE_URL),
        routes:routes
    }
)

export default router;